{extend name="admin@base"/}
{block name='second_menu'}
{notempty name="$menu[2]"}
<ul class="layui-nav nc-nav">
    {foreach name="$menu[2]" item="second_menu"}
    <li class="layui-nav-item {$second_menu['selected']}">
        <a href="{$second_menu['url']}" {$second_menu['target']}>{$second_menu['title']}</a>
    </li>
    {/foreach}
</ul>
{/notempty}
{/block}
{block name='crumbs'}{/block}
{block name="main"}
<table id="template_list" lay-filter="template_list"></table>

<script type="text/html" id="operation">
    <a class="default" lay-event="edit">编辑</a>
</script>
{/block}
{block name="script"}
<script>
	var table = new Table({
		elem: '#template_list',
		filter: "template_list",
		url: nc.url("sms://admin/config/template"),
		cols: [
			[
				{
					field: 'title',
					width: '10%',
					title: '短信模板'
				},
				{
					title: '操作',
					toolbar: '#operation',
					align: 'right'
				}
			]
		]
	});
	
	table.tool(function (obj) {
		var data = obj.data;
		switch (obj.event) {
			case "edit":
				location.href = nc.url('Sms://admin/config/editTemplate', {keyword : data.keyword })
				break;
		}
		
	});
</script>
{/block}